package com.fjh.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("微信公众号消息的对象")
public class WxModel {

    @JsonProperty(value = "touser")
    @ApiModelProperty("发送给哪个用户")
    private String toUser;

    @JsonProperty(value = "template_id")
    @ApiModelProperty("内容模板id")
    private String templateId;

    @JsonProperty(value = "url")
    @ApiModelProperty("链接")
    private String url;

    @JsonProperty(value = "topcolor")
    @ApiModelProperty("消息颜色")
    private String topColor;

    @JsonProperty(value = "data")
    @ApiModelProperty("数据包")
    private Map<String, Map<String, String>> data;


    public static Map<String, String> build(String value, String color) {
        HashMap<String, String> map = new HashMap<>();
        map.put("value", value);
        map.put("color", color);
        return map;
    }

}